package com.caipiao.lottery.lty.handler;

import com.caipiao.lottery.config.Config;

public class LtyHandlerFactory
{
	//Bean路径
	static String path = LtyHandlerFactory.class.getPackage().getName() + ".impl.LtyHandler";
	
	public static LtyHandler CreateHandler(String cmd)
	{
		try
		{
			String beanName = Config.Interface.GetPropValue("Cmd.HandlerClass", cmd);
			
			if (null == beanName || beanName.isEmpty())
			{
				beanName = path + cmd;
			}
			
			Class<?> handler = Class.forName(beanName);
			
			return (LtyHandler) handler.newInstance();
			
		}
		catch (Exception e)
		{
		}
		return null;
	};
}